package day0917Banking;

public class Account {
    private double balance;

    public Account(double init_balance) {
        this.balance = init_balance;
    }

    public double getBalance(String f, String l) {
        System.out.println("Creating an [" + f + l + "] account with a  " + this.balance);
        return this.balance;
    }

    public boolean deposit(double amt) {
        if (amt <= this.balance) {
            this.balance += amt;
            System.out.println("Deposit   " + amt + ":" + false);
            return true;
        } else {
            System.out.println("Withdrawal failure! " + amt + ":" + false);
            return false;
        }
    }

    public boolean withdraw(double amt) {
        if (amt <= this.balance) {
            this.balance -= amt;
            System.out.println("balance Withdraw " + amt + ":" + false);
            return true;
        } else {
            System.out.println("Withdrawal failure! " + amt + ":" + false);
            return false;
        }
    }
}